/**
 * 消息内页
 */
var localStorageManagers = require("script/localStorageManagers.js");
//mui初始化
mui.init({
	swipeBack:true
});
//plus初始化
mui.plusReady(plusReady);
//pluyReady
function plusReady(){
	//加载消息内容
	loadMsgContent();
};
//加载消息内容
function loadMsgContent(){
	ajaxLoadMsg();
}
//ajax加载消息内容
function ajaxLoadMsg(){
	var self=plus.webview.currentWebview();
	var msgid=self.msgid;
	var userid=localStorageManagers.getUseridSession();
	var url=serverAjax+'mobile/message/getMsgContent.do';
	mui.ajax(url,{
		data:{userid:userid,msgid:msgid},
		type:'post',
		dataType:'json',
		timeout:10000,
		success:function(data){
			if(data==null||data.length==0)return;
			buildMsgDiv(data);
		},
		error:function(e1,e2,e3){
			ajaxErrorTip();
			console.log(e1);
		}
	});
}
//构造div
function buildMsgDiv(data){
	document.getElementById('title').innerHTML=data.topic;
	document.getElementById('creattime').innerHTML=data.sendtime;
	document.getElementById('creator').innerHTML=data.sendUserName;
	document.getElementById('content').innerHTML=data.content;
}
